#ifndef XGE_X_SYS_LOG_H_
#define XGE_X_SYS_LOG_H_
// to use the common config
#include "xge_common_config.h"
#include "xallstatic.h"

namespace xge {
namespace xge_internal {

  // Log interface 
  class SystemLog : public AllStatic {
  public:
    // using this function to log the information into the system log
    // the system log can not alter its file name or anything , you can
    // only log information 
      
    static void Log ( int level , bool flush , const char_t* filename , const char_t* func , const char_t * , ... );
    // initialize routine do not return status code , since if
    // it encounter fatal error, there is no way for the calling routine
    // if it return , it must have succeeded otherwise the process will terminate

    static void Initialize();
  private:
    // You do not have to call destroy explicitly 
    // it will be destroyed by using at-exit-manager
    static void Destroy ();
  private:
    static void* kContext;
  };

}// xge_internal
}// namespace xge

// A simple macro for using the system log 
#define SYS_LOG(Level,IsFlush,FormatString,...) \
  xge::xge_internal::SystemLog::Log(xge::Level,IsFlush,__X__FILE__,__X__FUNC__,FormatString, __VA_ARGS__ )

#endif// XGE_X_SYS_LOG_H_